<template>
  <section class="page">
    <div style="margin-bottom: 15px">
      <!-- 抬头 -->
      <div class="title">{{ this.propsForm.title || "" }}有限公司</div>
      <div class="title">订 购 单</div>
      <div class="horizontal-direction" style="margin-bottom: 10px; position: relative">
        <div class="horizontal-box">
          供应商：<span>{{ this.propsForm.fullnmTC || "" }}</span>
        </div>
        <div class="horizontal-box" style="position: absolute; right: 0">
          订购单号：<span>{{ this.propsForm.orderNo || "" }}</span>
        </div>
      </div>
      <div class="horizontal-direction" style="margin-bottom: 10px; position: relative">
        <div class="horizontal-box">
          地址：<span>{{ this.propsForm.place || "" }}</span>
        </div>
        <div class="horizontal-box" style="position: absolute; right: 0">
          品牌：<span>{{ this.propsForm.brand || "" }}</span>
        </div>
      </div>
      <div class="horizontal-direction" style="margin-bottom: 10px; position: relative">
        <div class="horizontal-box">
          电话/传真：<span>{{ this.propsForm.vrFax || "" }}</span>
        </div>
        <div class="horizontal-box" style="position: absolute; right: 0">
          下单日期：<span>{{ this.propsForm.ordDate.substring(0, 10) || "" }}</span>
        </div>
      </div>
      <div class="horizontal-direction" style="margin-bottom: 10px; position: relative">
        <div class="horizontal-box">
          开发员：<span>{{ this.propsForm.developer || "" }}</span>
        </div>
      </div>
      <!-- 表格 -->
      <table cellspacing="0" cellpadding="0" border="1" class="out-table" style="width: 100%">
        <thead class="has-gutter">
          <tr class="text-center">
            <th><div>序</div></th>
            <th><div>材料名称</div></th>
            <th><div>单位</div></th>
            <th><div>数量</div></th>
            <th><div>季节</div></th>
            <th><div>样品阶段</div></th>
            <th><div>型体编号</div></th>
            <th><div>型体</div></th>
            <th><div>使用部位</div></th>
            <th><div>要求交期</div></th>
            <th><div>样鞋出货数量</div></th>
            <th><div>单位用量</div></th>
            <th><div>备注</div></th>
          </tr>
        </thead>
        <tbody>
          <template v-for="item in this.propsForm.detailList || []">
            <tr :key="item + 'only'">
              <td>{{ item.orderSeq }}</td>
              <td>{{ item.itemName }}</td>
              <td>{{ item.unit }}</td>
              <td>{{ item.ordQty }}</td>
              <td>{{ item.seasonName }}</td>
              <td>{{ item.stageName }}</td>
              <td>{{ item.prodNo }}</td>
              <td>{{ item.prodName }}</td>
              <td>{{ item.part }}</td>
              <td>{{ item.reqDate }}</td>
              <td>{{ item.spQty }}</td>
              <td>{{ item.bQty }}</td>
              <td>{{ item.remark }}</td>
            </tr>
          </template>
        </tbody>
      </table>
    </div>
    <div class="base-stamp" style="margin-top: 3em">
      <table cellspacing="0" cellpadding="0" border="0" class="el-table__header table-flow">
        <thead class="has-gutter">
          <tr class="text-left">
            <th><div class="examine-cell">签核角色</div></th>
            <th><div class="examine-cell">审核人员</div></th>
            <th><div class="examine-cell">审核状况</div></th>
            <th><div class="examine-cell">审核意见</div></th>
            <th><div class="examine-cell">审核时间</div></th>
          </tr>
        </thead>
        <tbody>
          <template>
            <tr class="text-left" v-for="(item, index) in propsForm.qhChkmgrdList || []" :key="index">
              <td>
                <div>{{ item.flowDesc }}</div>
              </td>
              <td>
                <div>{{ item.toUserCname }}</div>
              </td>
              <td>
                <div>{{ item.chkStatusName }}</div>
              </td>
              <td>
                <div>{{ item.chkOk }}</div>
              </td>
              <td>
                <div>{{ item.chkDate }}</div>
              </td>
            </tr>
          </template>
        </tbody>
      </table>
    </div>
  </section>
</template>

<script>
module.exports = {
  props: {
    propsForm: {
      type: Object,
      required: true,
    },
  },
  data() {
    return {
      sessionStorageData: JSON.parse(sessionStorage.parameterData),
      applicationForm: {
        detailList: [],
      },
    };
  },
  computed: {
    total() {
      const list = this.propsForm.detailList;
      const total = list.reduce((pre, cur) => {
        pre += +cur.ordQty;
        return pre;
      }, 0);
      return +total.toFixed(2);
    },
  },
  mounted() {},
};
</script>

<style>
.page {
  margin: auto;
  width: 100%;
  max-width: 297mm;
}
.title {
  margin-bottom: 10px;
  font-size: 20px;
  font-weight: bold;
}
.out-table {
  border-collapse: separate;
  box-sizing: border-box;
}
.out-table th {
  background-color: #b3ffb3;
}
</style>
